package com.sojson.project.entity.po;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sojson.base.impl.BaseOrder;
import com.sojson.enums.EOrderDepositIsToBrokerage;
import com.sojson.enums.EOrderDepositStatus;
import com.sojson.enums.core.EPayStatus;
import com.sojson.enums.core.ERefundsStatus;
import com.sojson.util.DateUtil;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty.AccessMode;

/**
 * 诚意金订单表Bean
 * 
 * @author liu
 * @date 2021-04-29
 */
@ApiModel("诚意金订单表Bean")
public class OrderDeposit extends BaseOrder {

    /**
     * 此文件由工具自动生成，手动添加内容请放至末尾
     */

    private static final long serialVersionUID = 1619676653535L;

    @ApiModelProperty("订单号")
    private String orderSn;
    @ApiModelProperty("支付单号(微信生成的支付订单)")
    private String paySn;
    @ApiModelProperty("微信支付单号")
    private String payNoWx;
    @ApiModelProperty("支付宝支付单号")
    private String payNoZfb;
    @ApiModelProperty("支付金额")
    private BigDecimal payTotal;
    @ApiModelProperty("订单金额")
    private BigDecimal orderTotal;
    @ApiModelProperty("退款单号")
    private String refundSn;
    @ApiModelProperty("退款金额")
    private BigDecimal refundTotal;
    @ApiModelProperty("所属会员ID")
    private String mid;
    @ApiModelProperty("使用优惠券ID")
    private Integer couponId;
    @ApiModelProperty("支付方式 1微信支付 2支付宝支付")
    private Integer payType;
    @ApiModelProperty("状态(1:待付款,2:正常,3:已退款,4:已扣除,5:已退至余额,6:已关闭)")
    private Integer status;
    @ApiModelProperty("扣除类型(1:全部,2:一半)")
    private Integer deductType;
    @ApiModelProperty("扣除金额")
    private BigDecimal deductTotal;
    @ApiModelProperty("诚意金是否已转入余额(1:是,2:否)")
    private Integer isToBrokerage;
    @ApiModelProperty("扣除应聘岗位记录ID")
    private String deductPostApplyId;
    @ApiModelProperty("扣除原因")
    private String deductMessage;
    @ApiModelProperty("是否已付款(1:已付款,2:未付款)")
    private Integer isPay;
    @ApiModelProperty("是否已退款(1:已退款,2:未退款,3:退款中)")
    private Integer isRefunds;
    @ApiModelProperty("订单备注")
    private String mark;
    @ApiModelProperty("创建时间")
    private Date createdAt;
    @ApiModelProperty("更新时间")
    private Date updatedAt;
    @ApiModelProperty("支付信息")
    private String payMsg;
    @ApiModelProperty("退款信息")
    private String refundsMsg;
    @ApiModelProperty(value = "是否查询用户当前的诚意金订单(true:是,false:否)", accessMode = AccessMode.READ_WRITE)
    private Boolean isFindMid;
    @ApiModelProperty(value = "姓名", accessMode = AccessMode.READ_WRITE)
    private String name;
    @ApiModelProperty(value = "手机号", accessMode = AccessMode.READ_WRITE)
    private String mobile;
    @ApiModelProperty("当前时间")
    private Date thisTime;
    /** 诚意金订单表集合 */
    private List<Integer> ids;
    /** 诚意金订单表集合 */
    private List<OrderDeposit> orderDeposits;

    /**
     * 以上由工具自动生成，以下为手动添加
     */

       /**
        * Empty constructor
        */
    public OrderDeposit() {

    }

    /**
     * 此文件由工具自动生成，手动添加内容请放至末尾
     */

    /**
     * 获取 订单号
     */
    public String getOrderSn() {
        return orderSn;
    }

    /**
     * 设置 订单号
     */
    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    /**
     * 获取 支付单号(微信生成的支付订单)
     */
    public String getPaySn() {
        return paySn;
    }

    /**
     * 设置 支付单号(微信生成的支付订单)
     */
    public void setPaySn(String paySn) {
        this.paySn = paySn;
    }

    /**
     * 获取微信支付单号
     * 
     * @return
     */
    public String getPayNoWx() {
        return payNoWx;
    }

    /**
     * 设置微信支付单号
     * 
     * @param payNoWx
     */
    public void setPayNoWx(String payNoWx) {
        this.payNoWx = payNoWx;
    }

    /**
     * 获取支付宝支付单号
     * 
     * @return
     */
    public String getPayNoZfb() {
        return payNoZfb;
    }

    /**
     * 设置支付宝支付单号
     * 
     * @param payNoZfb
     */
    public void setPayNoZfb(String payNoZfb) {
        this.payNoZfb = payNoZfb;
    }

    /**
     * 获取 支付金额
     */
    public BigDecimal getPayTotal() {
        return payTotal;
    }

    /**
     * 设置 支付金额
     */
    public void setPayTotal(BigDecimal payTotal) {
        this.payTotal = payTotal;
    }

    /**
     * 获取 订单金额
     */
    public BigDecimal getOrderTotal() {
        return orderTotal;
    }

    /**
     * 设置 订单金额
     */
    public void setOrderTotal(BigDecimal orderTotal) {
        this.orderTotal = orderTotal;
    }

    /**
     * 获取 退款单号
     */
    public String getRefundSn() {
        return refundSn;
    }

    /**
     * 设置 退款单号
     */
    public void setRefundSn(String refundSn) {
        this.refundSn = refundSn;
    }

    /**
     * 获取 退款金额
     */
    public BigDecimal getRefundTotal() {
        return refundTotal;
    }

    /**
     * 设置 退款金额
     */
    public void setRefundTotal(BigDecimal refundTotal) {
        this.refundTotal = refundTotal;
    }

    /**
     * 获取 所属会员ID
     */
    public String getMid() {
        return mid;
    }

    /**
     * 设置 所属会员ID
     */
    public void setMid(String mid) {
        this.mid = mid;
    }

    /**
     * 获取 使用优惠券ID
     */
    public Integer getCouponId() {
        return couponId;
    }

    /**
     * 设置 使用优惠券ID
     */
    public void setCouponId(Integer couponId) {
        this.couponId = couponId;
    }

    /**
     * 获取 支付方式 1微信支付 2支付宝支付
     */
    public Integer getPayType() {
        return payType;
    }

    /**
     * 设置 支付方式 1微信支付 2支付宝支付
     */
    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    /**
     * 获取 状态(1:待付款,2:正常,3:已退款,4:已扣除,5:已退至余额,6:已关闭)
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置 状态(1:待付款,2:正常,3:已退款,4:已扣除,5:已退至余额,6:已关闭)
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 获取扣除类型(1:全部,2:一半)
     * 
     * @return
     */
    public Integer getDeductType() {
        return deductType;
    }

    /**
     * 设置扣除类型(1:全部,2:一半)
     * 
     * @param deductType
     */
    public void setDeductType(Integer deductType) {
        this.deductType = deductType;
    }

    /**
     * 获取扣除金额
     * 
     * @return
     */
    public BigDecimal getDeductTotal() {
        return deductTotal;
    }

    /**
     * 设置扣除金额
     * 
     * @param deductTotal
     */
    public void setDeductTotal(BigDecimal deductTotal) {
        this.deductTotal = deductTotal;
    }

    /**
     * 获取诚意金是否已转入余额(1:是,2:否)
     * 
     * @return
     */
    public Integer getIsToBrokerage() {
        return isToBrokerage;
    }

    /**
     * 设置诚意金是否已转入余额(1:是,2:否)
     * 
     * @param isToBrokerage
     */
    public void setIsToBrokerage(Integer isToBrokerage) {
        this.isToBrokerage = isToBrokerage;
    }

    /**
     * 获取扣除应聘岗位记录ID
     * 
     * @return
     */
    public String getDeductPostApplyId() {
        return deductPostApplyId;
    }

    /**
     * 设置扣除应聘岗位记录ID
     * 
     * @param deductPostApplyId
     */
    public void setDeductPostApplyId(String deductPostApplyId) {
        this.deductPostApplyId = deductPostApplyId;
    }

    /**
     * 获取扣除原因
     * 
     * @return
     */
    public String getDeductMessage() {
        return deductMessage;
    }

    /**
     * 设置扣除原因
     * 
     * @param deductMessage
     */
    public void setDeductMessage(String deductMessage) {
        this.deductMessage = deductMessage;
    }

    /**
     * 获取 是否已付款(1:已付款,2:未付款)
     */
    public Integer getIsPay() {
        return isPay;
    }

    /**
     * 设置 是否已付款(1:已付款,2:未付款)
     */
    public void setIsPay(Integer isPay) {
        this.isPay = isPay;
    }

    /**
     * 获取 是否已退款(1:已退款,2:未退款,3:退款中)
     */
    public Integer getIsRefunds() {
        return isRefunds;
    }

    /**
     * 设置 是否已退款(1:已退款,2:未退款,3:退款中)
     */
    public void setIsRefunds(Integer isRefunds) {
        this.isRefunds = isRefunds;
    }

    /**
     * 获取 订单备注
     */
    public String getMark() {
        return mark;
    }

    /**
     * 设置 订单备注
     */
    public void setMark(String mark) {
        this.mark = mark;
    }

    /**
     * 获取 创建时间
     */
    public Date getCreatedAt() {
        return createdAt;
    }

    /**
     * 设置 创建时间
     */
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    /**
     * 获取 更新时间
     */
    public Date getUpdatedAt() {
        return updatedAt;
    }

    /**
     * 设置 更新时间
     */
    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    /**
     * 获取 支付信息
     */
    public String getPayMsg() {
        return payMsg;
    }

    /**
     * 设置 支付信息
     */
    public void setPayMsg(String payMsg) {
        this.payMsg = payMsg;
    }

    /**
     * 获取 退款信息
     */
    public String getRefundsMsg() {
        return refundsMsg;
    }

    /**
     * 设置 退款信息
     */
    public void setRefundsMsg(String refundsMsg) {
        this.refundsMsg = refundsMsg;
    }

    /**
     * 获取是否查询用户当前的诚意金订单
     * 
     * @return
     */
    public Boolean getIsFindMid() {
        return isFindMid;
    }

    /**
     * 设置是否查询用户当前的诚意金订单
     * 
     * @param isFindMid
     */
    public void setIsFindMid(Boolean isFindMid) {
        this.isFindMid = isFindMid;
    }

    /**
     * 获取姓名
     * 
     * @return
     */
    @JsonIgnore
    @JSONField(serialize = false)
    public String getName() {
        return name;
    }

    /**
     * 设置姓名
     * 
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取手机号
     * 
     * @return
     */
    @JsonIgnore
    @JSONField(serialize = false)
    public String getMobile() {
        return mobile;
    }

    /**
     * 设置手机号
     * 
     * @param mobile
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    /**
     * 获取当前时间
     * 
     * @return
     */
    public Date getThisTime() {
        return thisTime;
    }

    /**
     * 设置当前时间
     * 
     * @param thisTime
     */
    public void setThisTime(Date thisTime) {
        this.thisTime = thisTime;
    }

    /**
     * 获取 诚意金订单表集合
     */
    public List<Integer> getIds() {
        return ids;
    }

    /**
     * 设置 诚意金订单表集合
     */
    public void setIds(List<Integer> ids) {
        this.ids = ids;
    }

    /**
     * 获取 诚意金订单表集合
     */
    public List<OrderDeposit> getOrderDeposits() {
        return orderDeposits;
    }

    /**
     * 设置 诚意金订单表集合
     */
    public void setOrderDeposits(List<OrderDeposit> orderDeposits) {
        this.orderDeposits = orderDeposits;
    }

    @Override
    public Integer getBaseOrderType() {
        return null;
    }

    @Override
    public Integer getBasePayType() {
        return getPayType();
    }

    @Override
    public String getBaseOrderNo() {
        return getOrderSn();
    }

    @Override
    public String getBaseOrderNoShop() {
        return getOrderSn();
    }

    @Override
    public BigDecimal getBaseOrderTotal() {
        return getOrderTotal();
    }

    @Override
    public BigDecimal getBasePayTotal() {
        return getPayTotal();
    }

    @Override
    public String getBaseRefundNo() {
        return getRefundSn();
    }

    @Override
    public BigDecimal getBaseRefundTotal() {
        return getRefundTotal();
    }

    /**
     * 以上由工具自动生成，以下为手动添加
     */

    /**
     * 插入初始化
     */
    public void insertInit() {
        setStatus(EOrderDepositStatus.PAYMENT_NO.getCode());
        setIsPay(EPayStatus.NO.getCode());
        setIsRefunds(ERefundsStatus.NO.getCode());
        setIsToBrokerage(EOrderDepositIsToBrokerage.NO.getCode());
        setDeductTotal(new BigDecimal("0"));
        Date now = DateUtil.nowDate();
        setCreatedAt(now);
        setUpdatedAt(now);
    }

    /**
     * 更新初始化
     */
    public void updateInit() {
        Date now = DateUtil.nowDate();
        setUpdatedAt(now);
    }

    /**
     * 退款初始化
     * 
     * @param orderNo       订单号
     * @param orderTotal    订单金额
     * @param refundNo      退款单号
     * @param refundTotal   退款金额
     * @param payType       支付类型
     */
    @Override
    public void refundInit(String orderNo, BigDecimal orderTotal, String refundNo, BigDecimal refundTotal,
        Integer payType) {
        setOrderSn(orderNo);
        setOrderTotal(orderTotal);
        setRefundSn(refundNo);
        setRefundTotal(refundTotal);
        setPayType(payType);
    }

}